

import axios from '@/api/fetch';
import SERVER from '@/api/server';
import * as types from './types';

// 经销商入网维护分页查询
export const searchDealerApply = (_params) => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply`, {params:_params,menuId:'-1'});

// 经销商入网维护新增
export const insertDealerApply = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply`,  params );

// 经销商入网维护-生成临时账号
export const createDealer = (params, id) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply/save/createDealer/${id}`,  params );
// 经销商入网维护-转正式经销商
export const turnDealer = (params, id) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply/save/turnDealer/${id}`,  params );
// 经销商建设信息审核-审核通过
export const passDealer = (params, id) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply/save/passDealer/${id}`,  params );
// 经销商建设信息审核-反馈基本信息保存
export const saveDealer = (params, id) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply/save/saveDealer/${id}`,  params );


// 经销商入网维护修改
export const updataDealerApply = (params, id) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply/${id}`,  params );

// 查询当前登录用户信息
export const getCurrentUser = params => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply/user/getCurrentUser`, { params });

// 经销商入网维护分页查询
export const getDealerApply = (_params) => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply/dealer/getApply`, {params:_params,menuId:'-1'});

// 经销商入网申请-进度节点分页查询
export const searchDealerApplyPnode = (_params) => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyPnode`, {params:_params,menuId:'-1'});


// 经销商入网申请-订购节点分页查询
export const searchDealerApplyOnode = (_params) => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyOnode`,{params:_params,menuId:'-1'});


// 经销商入网申请-总部反馈分页查询
export const searchDealerApplyOemFeedback = (_params) => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyOemFeedback`, {params:_params,menuId:'-1'});

// 经销商入网申请-施工进度反馈分页查询
export const searchDealerApplyDealerFeedback = (_params) => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyDealerFeedback`, {params:_params,menuId:'-1'});

// 经销商入网申请-施工进度反馈新增
export const insertDealerApplyDealerFeedback = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyDealerFeedback`,  params );

// 经销商入网申请-施工进度反馈修改
export const updataDealerApplyDealerFeedback = (params, id) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyDealerFeedback/${id}`,  params );

// 经销商入网申请-施工进度反馈-删除
export const deleteDealerFeedbackById = (id) => axios.delete(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyDealerFeedback/${id}`, {params:{id:id},menuId:'-1'});


// 经销商入网申请-其他施工照片新增-保存
export const insertOtherPhoto = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply/dealer/insertOtherPhoto`,  params );

// 经销商入网申请-其他施工照片新增-提交
export const insertOtherPhotoSubmit = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply/dealer/insertOtherPhotoSubmit`,  params );

// 其他施工照片查询
export const searchOtherPhoto = (params, id) => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply/dealer/insertOtherPhoto/${id}`,   { params } );

// 经销商入网申请-建设验收-导出
export const exportExcel = params => {
    params = Object.assign(params,{menuId:'-1'});
    return axios({
        url:`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApply/export/excel`,
        method:'get',
        params:params,
        responseType: 'blob'
    });
};


// 进度节点新增
export const insertDealerApplyPnode = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyPnode`,  params );

// 进度节点修改
export const updataDealerApplyPnode = (params, id) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyPnode/${id}`,  params );

// 进度节点删除
export const delProgressById = (id) => axios.delete(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyPnode/${id}`, {params:{id:id},menuId:'-1'});

// 订购节点新增
export const insertDealerApplyOrder = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyOnode`,  params );

// 订购节点修改
export const updataDealerApplyOrder = (params, id) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyOnode/${id}`,  params );

// 订购节点删除
export const delOrderById = (id) => axios.delete(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyOnode/${id}`, {params:{id:id},menuId:'-1'});

// 总部反馈节点新增
export const insertDealerApplyOemFeed = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyOemFeedback`,  params );

// 总部反馈节点修改
export const updataDealerApplyOemFeed = (params, id) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyOemFeedback/${id}`,  params );

// 总部反馈节点删除
export const delOemFeedById = (id) => axios.delete(`${SERVER.CMSCLOUD_CHANNEL}/apply/dealerApplyOemFeedback/${id}`, {params:{id:id},menuId:'-1'});


